# Contributor: Francesco Camuffo <dev@fmac.xyz>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=ugrep
pkgver=7.0.2
pkgrel=0
pkgdesc="Ultra fast grep with interactive query UI and fuzzy search"
url="https://ugrep.com/"
arch="all"
license="BSD-3-Clause"
checkdepends="bash"
makedepends="
	brotli-dev
	bzip2-dev
	bzip3-dev
	linux-headers
	lz4-dev
	pcre2-dev
	xz-dev
	zlib-dev
	zstd-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/Genivia/ugrep/archive/refs/tags/v$pkgver.tar.gz"

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--with-bzip3
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
54171d39084f2b4042ba290ab537df9c56f1d292c9f651042a7a8c713071db7f8bc3ce040f403b5f13e258797593f75fe4298fbecea38018a1fa6dee8efccb45  ugrep-7.0.2.tar.gz
"
